import 'package:flutter/material.dart';

///
/// 卡片中强化展示，数字信息
///
class QEnhanceNumberCard extends StatelessWidget {
  final List<NumberCardModel> dataList;
  final double? leftPadding;
  final double? numberFontSize;
  final double? nameFontSize;

  const QEnhanceNumberCard({
    Key? key,
    required this.dataList,
    this.leftPadding,
    this.numberFontSize,
    this.nameFontSize,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var item = Row(
      children: dataList.map((e) {
        return Expanded(
          child: Padding(
            padding: EdgeInsets.only(left: leftPadding ?? 10),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  e.number,
                  style:
                  TextStyle(fontSize: numberFontSize ?? 30, fontWeight: FontWeight.bold),
                ),
                Text(
                  e.name,
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(fontSize: nameFontSize ?? 12),
                ),
              ],
            ),
          ),
        );
      }).toList(),
    );
    return item;
  }
}

class NumberCardModel {
  final String number;
  final String name;

  NumberCardModel({required this.number, required this.name});
}
